<?php

class UsersVideosCommentsController extends AppController{
    
    public $helpers = array('Html', 'Session', 'Paginator', 'Js');
    
    public $paginate = array(
        //'Comments' => array(
             'limit' => 25,
             'order' => array(
                 'UsersVideosComment.posted_on' => 'DESC'
             ),
             'fields' => array(
                 'User.*', 'UsersVideosComment.*',
             ), 
             'limit' => 5,
    //)
    );
    
    public function getPaginatedComments($videoId ){
        
        $this->paginate['conditions'] = array(
            'UsersVideosComment.users_videos_id' => $videoId
        );
        $data = $this->paginate();
        
        $this->set('comments', $data);
    }
}
?>
